using Assets.Scripts.GDK;
using UnityEngine;

namespace Brick
{
	public class PropPanel : gdk_base_panel
	{
		public RectTransform scrollContent;

		public RectTransform rowItemBox;

		public override void OnLoad()
		{
			initData();
		}

		public void initData()
		{
			rowItemBox.gameObject.SetActive(value: true);
			gdk_utils.removeAllChildren(scrollContent);
			int num = 5;
			int index = GameData.index;
			for (int i = 0; i < num; i++)
			{
				RectTransform rectTransform = Object.Instantiate(rowItemBox);
				rectTransform.gameObject.SetActive(value: true);
				rectTransform.SetParent(scrollContent, worldPositionStays: false);
				PropModel propInfo = GDK.ModuleManger.Module<PropPanelModule>().GetPropInfo_Chinese(i);// GDK.ModuleManger.Module<PropPanelModule>().GetPropInfo(i);
				rectTransform.GetComponent<PropItem>().OnData(i, propInfo);
			}
			rowItemBox.gameObject.SetActive(value: false);
		}

		public void OnCloseClick()
		{
			gdk_game_manager.PlaySound(AudioID.click);
			close();			
		}
	}
}

